package nl.hanze.designpatterns;

import nl.hanze.designpatterns.DAO.impl.file.ser.QuestionFDAOImpl;
import nl.hanze.designpatterns.Domain.Answer;
import nl.hanze.designpatterns.Domain.Question;

import java.io.File;

/**
 *
 * Created by Aron on 6-10-2014.
 */
public class GenerateQAObjSerialized {
    public static void main(String [] args) {
        generate();
    }

    public static void generate() {
        Question qaObj0 = new Question();
        qaObj0.setText("This is the start?");

        Question qaObj00 = new Question(qaObj0);
        qaObj00.setText("What is the answer to life the universe and everything?");
        Answer qaObj01 = new Answer(qaObj0);
        qaObj01.setText("Well yes, my good sir.");


        Answer qaObj000 = new Answer(qaObj00);
        qaObj000.setText("42.");
        Question qaObj001 = new Question(qaObj00);
        qaObj001.setText("This is the end?");
        Question qaObj002 = new Question(qaObj00);
        qaObj002.setText("What is the meaning of life?");
        Answer qaObj004 = new Answer(qaObj00);
        qaObj004.setText("39.");

        Answer qaObj0020 = new Answer(qaObj002);
        qaObj0020.setText("nothing.");

        QuestionFDAOImpl.Serialize(qaObj0);
        Question qaObjResult = QuestionFDAOImpl.Deserialize();
        System.out.println(qaObjResult.getQuestions().size());
    }
}
